﻿using SqlSugar;

namespace Blog.Models.Entitys
{
    /// <summary>
    /// 文章
    /// </summary>
    [SugarTable(TableDescription = "文章")]
    public class BlogArticle : BaseEntity
    {
        [SugarColumn(ColumnDescription = "封面", Length = 200)]
        public string? Cover { get; set; }

        [SugarColumn(ColumnDescription = "文章名称", Length = 100)]
        public string? Name { get; set; }

        [SugarColumn(ColumnDescription = "文章标签,不同标签用逗号隔开", Length = 200)]
        public string? Tag { get; set; }

        [SugarColumn(ColumnDescription = "文章内容", ColumnDataType = "ntext")]
        public string? Content { get; set; }

        [SugarColumn(ColumnDescription = "文章状态,1:发布 2:草稿 3:弃用")]
        public int? State { get; set; }

        [SugarColumn(ColumnDescription = "阅读数量")]
        public int? ReadNumber { get; set; } = 0;

        [SugarColumn(ColumnDescription = "文章点赞数")]
        public int? ThumbNumber { get; set; } = 0;

        [SugarColumn(ColumnDescription = "修改时间")]
        public DateTime? UpdateTime { get; set; } = DateTime.Now;

        [SugarColumn(ColumnDescription = "是否置顶")]
        public bool IsTop { get; set; } = false;

        [SugarColumn(ColumnDescription = "关连用户")]
        public int? UserId { get; set; }

        [SugarColumn(ColumnDescription = "文章分类,关连分类")]
        public int? TypeId { get; set; }
    }
}
